﻿<UserControl x:Class="DIST.LR.ZHJG.Controls.Chart.ucMultiBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"
    xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
    xmlns:charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
    HorizontalAlignment="Center" VerticalAlignment="Center"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <SolidColorBrush x:Key="Barbrush_cj" Color="#FF004A88" />
        <SolidColorBrush x:Key="Barbrush_gg" Color="#FF2FAD41" />
        
        <SolidColorBrush x:Key="CustomAxisColor" Color="#FFFF6900" />
        <Style x:Key="AxisLineStyle3" TargetType="Line">
            <Setter Property="Stroke" Value="{StaticResource CustomAxisColor}" />
        </Style>
        <Style x:Key="MajorTickLineStyle3" TargetType="Line">
            <Setter Property="Stroke" Value="{StaticResource CustomAxisColor}" />
        </Style>
        <Style x:Key="CustomLabel3" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource CustomAxisColor}" />
        </Style>

        <Style x:Key="CustomLegendItem" TargetType="charting:ChartLegendItem">
            <Setter Property="Width" Value="110" />
            <Setter Property="Template" >
                <Setter.Value>
                    <ControlTemplate TargetType="charting:ChartLegendItem">
                        <Grid x:Name="PART_MainContainer" Background="{TemplateBinding Background}"
                        HorizontalAlignment="Stretch" VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Path x:Name="PART_LegendItemMarker" 
                                  Width="16"
                                  Height="16"
                                  Margin="{TemplateBinding Margin}"
                                  StrokeThickness="{TemplateBinding MarkerStrokeThickness}"
                                  Style="{TemplateBinding ItemStyle}"
                                  Stretch="Fill"
                                  VerticalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry x:Name="PART_ItemMarkerGeometry" />
                                </Path.Data>
                            </Path>
                            <TextBlock x:Name="PART_TextBlock"
                                       Grid.Column="1"
                                       Padding="{TemplateBinding Padding}"
                                       Margin="{TemplateBinding Margin}"
                                       Foreground="{TemplateBinding Foreground}"
                                       Text="{TemplateBinding Label}"
                                       TextWrapping="Wrap" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <!--<UserControl.DataContext>
        <local:ucMultiBarViewModel />
    </UserControl.DataContext>-->

    <Grid x:Name="LayoutRoot" Background="White">
        <chart:RadChart x:Name="RadChart1">
            <!--<chart:RadChart.SeriesMappings>
                <charting:SeriesMapping LegendLabel="Population" ItemsSource="{Binding DataSource1}">
                    <charting:ItemMapping DataPointMember="YValue" FieldName="Population" />
                    <charting:ItemMapping DataPointMember="XCategory" FieldName="Country" />
                </charting:SeriesMapping>
                
                <charting:SeriesMapping LegendLabel="Vehicles in circulation" ItemsSource="{Binding DataSource2}">
                    <charting:ItemMapping DataPointMember="YValue" FieldName="Vehicles" />
                    <charting:ItemMapping DataPointMember="XCategory" FieldName="Country" />
                </charting:SeriesMapping>
                
                <charting:SeriesMapping LegendLabel="Road network length (km)" ItemsSource="{Binding DataSource3}">
                    <charting:SeriesMapping.SeriesDefinition>
                        <charting:BarSeriesDefinition AxisName="Secondary" ItemLabelFormat="#Y{0,.# k}" />
                    </charting:SeriesMapping.SeriesDefinition>
                    <charting:ItemMapping DataPointMember="YValue" FieldName="RoadNetwork" />
                    <charting:ItemMapping DataPointMember="XCategory" FieldName="Country" />
                </charting:SeriesMapping>     
            </chart:RadChart.SeriesMappings>-->
            
            <chart:RadChart.DefaultView>
                <charting:ChartDefaultView>
                    <charting:ChartDefaultView.ChartArea>
                        <charting:ChartArea LegendName="ChartLegend1"  ItemWidthPercent="50" NoDataString="请查询">
                            <charting:ChartArea.AxisY>
                                <charting:AxisY AutoRange="True" MinValue="0" MaxValue="60" Step="10"
                                                AxisLabelsVisibility="Collapsed" IsInverse="False" LabelRotationAngle="0" 
                                                MajorGridLinesVisibility="Collapsed" MinorGridLinesVisibility="Collapsed"
                                                MajorTicksVisibility="Visible" MinorTicksVisibility="Visible"
                                                StripLinesVisibility="Collapsed"
                                                PlotAreaAxisVisibility="Collapsed" PlotAreaAxisLabelsVisibility="Collapsed"
                                                IsLogarithmic="False" IsZeroBased="True" ExtendDirection="Smart"
                                                />
                            </charting:ChartArea.AxisY>
                            <!--<charting:ChartArea.AxisY>
                                <charting:AxisY AutoRange="False" MinorTicksVisibility="Collapsed" MinValue="0" MaxValue="100000000" Step="20000000">
                                </charting:AxisY>
                            </charting:ChartArea.AxisY>-->
                            <!--<charting:ChartArea.AdditionalYAxes>
                                <charting:AxisY x:Name="secondaxis" AxisName="Secondary" MinorTicksVisibility="Collapsed" DefaultLabelFormat="#VAL{0,.## k}"
                                                   AutoRange="False" MinValue="0" MaxValue="1200000" Step="200000">
                                    <charting:AxisY.AxisStyles>
                                        <charting:AxisStyles AxisLineStyle="{StaticResource AxisLineStyle3}"
                                                                TickLineStyle="{StaticResource MajorTickLineStyle3}"
                                                                ItemLabelStyle="{StaticResource CustomLabel3}"/>
                                    </charting:AxisY.AxisStyles>
                                </charting:AxisY>
                            </charting:ChartArea.AdditionalYAxes>-->
                        </charting:ChartArea>
                    </charting:ChartDefaultView.ChartArea>
                    
                    <charting:ChartDefaultView.ChartLegend>
                        <charting:ChartLegend x:Name="ChartLegend1" LegendItemStyle="{StaticResource CustomLegendItem}" Header="" />
                    </charting:ChartDefaultView.ChartLegend>        
                </charting:ChartDefaultView>
            </chart:RadChart.DefaultView>
        </chart:RadChart>

    </Grid>
</UserControl>
